package com.chuguan.poker.mytest;


import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

import com.chuguan.poker.Dao.UserDao;
import com.chuguan.poker.entity.UserEntity;

public class MyTest {
	@Test
	public void testName() throws Exception {
		ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
		SqlSessionFactory factory = (SqlSessionFactory) context.getBean("mySqlSession");
		SqlSession openSession = factory.openSession(true);
		UserDao mapper = openSession.getMapper(UserDao.class);
		mapper.insertUser(new UserEntity("chuguan",25));
		
	}
}
